package com.epadmin.finanse.dochody;

import com.epadmin.finanse.Finanse;

public class DochodView {

	public String getData() {
		StringBuilder sb = new StringBuilder();

		for (Dochod item : new DochodMdt().getList()) {
			sb.append(item.getAsJson());
			sb.append(",");
		}

		if (!(sb.length() == 0)) {
			sb.deleteCharAt(sb.length() - 1);
		}
		return sb.toString();
	}

	public String getGroupByMonthData() {
		StringBuilder sb = new StringBuilder();

		for (Finanse item : new DochodMdt().getListByMonth()) {
			sb.append(item.getAsJson());
			sb.append(",");
		}

		if (!(sb.length() == 0)) {
			sb.deleteCharAt(sb.length() - 1);
		}
		return sb.toString();

	}
}
